package com.wangsai.framework.supersecurity.example.cloud.client;

import cn.hutool.extra.spring.SpringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author Mr.Wang
 * @description
 * @date 2021-08-16 09:56
 */
@Slf4j
@EnableZuulProxy
@EnableDiscoveryClient
@SpringBootApplication
public class SuperSecurityCloudClientApplication {

    public static void main(String[] args) throws UnknownHostException {
        SpringApplication.run(SuperSecurityCloudClientApplication.class, args);
        Environment env = SpringUtil.getBean(Environment.class);
        log.info("\n----------------------------------------------------------\n\t" +
                        "*************应用【{}】启动成功!*************\n\t" +
                        "项目访问地址: \thttp://{}:{}\n\t" +
                        "接口文档地址: \thttp://{}:{}/doc.html\n" +
                        "----------------------------------------------------------",
                env.getProperty("spring.application.name"),
                InetAddress.getLocalHost().getHostAddress(),
                env.getProperty("server.port"),
                InetAddress.getLocalHost().getHostAddress(),
                env.getProperty("server.port"));
    }

}